package edu.ucla.cs.typecast.app.news;

public class NewsArticleFactory {
	public static NewsArticle generate(String className, String content) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
		NewsArticle article = (NewsArticle) Class.forName(className).newInstance();
		article.setContent(content);
		return article;
	}
	
	public static NewsArticle generate(Class cls, String content) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
		NewsArticle article = (NewsArticle) cls.newInstance();
		article.setContent(content);
		return article;
	}
}
